<% content_for :after_javascript_libraries do %>
  <%= javascript_include_tag 'refinery/sortable_list' %>
  <%= javascript_include_tag 'refinery/nestedsortables' %>
  <%= javascript_include_tag 'refinery/serializelist' %>
  <%= javascript_include_tag 'refinery/tree' %>
<% end %>

<% content_for :javascripts do %>
  <script>
    $(document).ready(function(){
      create_sortable_list(
        <%= raw({
              update_url: refinery.url_for(action: "update_positions", only_path: true),
              sortable_list: '#sortable_list, .sortable_list',
              tree: false,
              replaceContentsAfterUpdate: false
            }.merge(options ||= {}).to_json) %>
      );
    });
  </script>
<% end %>
